package com.project.personnel.controller;


import com.project.personnel.entity.Role;
import com.project.personnel.service.RoleService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author diaominyh
 * @since 2022-12-12
 */
@RestController
@RequestMapping("/role")
public class RoleController {
    @Resource
    private RoleService roleService;
    @GetMapping("/roleCha")
    //查询权限组
    public List<Role> roleCha(){
        return roleService.list();
    }
    @PostMapping("/roleAdd")
    //添加权限组
    public boolean roleAdd(@RequestBody Role role){
        return roleService.save(role);
    }
}

